//
//  DatabaseManager.h
//  TabBarViewProgrammatically
//
//  Created by Cuong Doan on 1/24/13.
//  Copyright (c) 2013 Cuong Doan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "sqlite3.h"
#import "Common.h"

@interface DatabaseManager : NSObject

+(void)openAndPrepareDatabase:(sqlite3 **)db andStatement:(sqlite3_stmt **)statement andSQL:(const char *)sql;

+(void)openAndPrepareDatabaseV2:(sqlite3 **)db andStatement:(sqlite3_stmt **)statement andSQL:(const char *)sql;

+(void)prepareDatabase:(sqlite3 *)db andStatement:(sqlite3_stmt **)statement andSQL:(const char *)sql;

+(void)bindText:(sqlite3_stmt *)statement andValue:(NSString *)value andIndex:(int)index;

+(void)bindInt:(sqlite3_stmt *)statement andValue:(int)value andIndex:(int)index;

+(void)bindDouble:(sqlite3_stmt *)statement andValue:(double)value andIndex:(int)index;

+(void)bindDate:(sqlite3_stmt *)statement andValue:(NSDate *)date andIndex:(int)index;

+(NSDate *)columnDate:(sqlite3_stmt *)statement andIndex:(int)index;

@end
